package com.example.module.sys.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 后台资源表
 * </p>
 *
 * @author Administrator
 * @since 2021-11-13
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_permission")
public class Permission extends Model<Permission> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 资源名称
     */
    private String name;

    /**
     * 菜单代码
     */
    private String code;

    /**
     * 父级资源id
     */
    private Integer parentId;

    /**
     * 资源类别   1菜单  2权限
     */
    private Integer type;

    /**
     * 权限
     */
    private String permission;

    /**
     * 图标
     */
    private String icon;

    /**
     * 路径
     */
    private String url;

    /**
     * 组件
     */
    private String component;

    /**
     * 菜单排序
     */
    private Integer sort;

    /**
     * 当前层级
     */
    private Integer level;

    /**
     * 资源介绍
     */
    private String remark;

    /**
     * 删除
     */
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Integer enable;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
